{if $mode != 1}
<input id="pictureId" type="hidden" name="{$formName}" value="{if isset($media)}{$media->getUniqueId()}{/if}"  />

<div id="picSelect" style="margin-bottom: 5px">
{/if}
    <div id="image">
    {if isset($media)}
        <div style="margin-bottom: 5px">{t}Preview{/t}</div>
        <img src="{$media->getMceIcon()}" rel="{$media->getLang()}/{$media->getUniqueId()}" />
    {/if}
    </div>

    {if isset($media)}
        {if !empty($sizes)}
            {t}Required sizes :{/t}
            {foreach from=$sizes item=size}
                <div style="padding: 5px 0;">
                    {assign var=formatedSize value=$size.width|cat:' x '|cat:$size.height}
                    {if empty($size.media)}
                    {t assignTo=help}Warning - The selected picture has no declination for the required size. You can resize or crop the selected picture by clicking on the resize button.{/t}
                    {icon name=warning.png class='itemButtonLeft' style="padding:0 2px;float:left;" title=$help class="toolTip"}
                    {else}
                    <a href="{$size.media}" class="itemButton itemViewButton itemButtonLeft toolTip" style="margin-top: -2px" title="{t}Preview - Click here to preview the resized picture that will be used by the front-office.{/t}" target="_blank"></a>
                    {/if}
                    <a href="javascript:void(0);" class="itemButton itemSizeButton itemButtonLeft toolTip" style="margin-top: -2px" onclick="centeredPopup('{$URL_RELATIVE}/index.php?module=medias&action=AjaxEditImage&folderId={$media->getFolderId()}&docId={$media->getUniqueId()}&docLang={$media->getLang()}&width={$size.width}&height={$size.height}&opener=pictureselect','Edition', 1024, 768);" title="{t}Resize - Click here to resize or crop the selected picture to the required size.{/t}"></a>
                    <span style="display: inline-block; margin: 2px 0 0 5px;">{$formatedSize}</span>
                </div>
            {/foreach}
        {else}
            {t}No picture resizing is needed by the front office{/t}
        {/if}
    {else}
        {t}No media linked to the document.{/t}
    {/if}
{if $mode != 1}
</div>
<a href="javascript:void(0);" class="addImg itemButton itemMediaButton itemButtonLeft toolTip" title="{t}Link - Click here to select a media to link or to change the current linked media.{/t}"></a>&nbsp;&nbsp;
<a href="javascript:void(0);" class="removeLinkedImage itemButton itemDeleteButton itemButtonLeft toolTip" {if !isset($media) || $media == ""}style="display:none;"{/if} title="{t}Unlink - Click here to delete the link with the current linked media{/t}"></a>
{/if}